package cn.edu.cqyz.wisdom.controller;

import cn.edu.cqyz.wisdom.entity.R;
import cn.edu.cqyz.wisdom.service.IClockService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 打卡记录表 前端控制器
 * </p>
 *
 * @author CDHong.it
 * @since 2024-12-18
 */
@RestController
@RequestMapping("/clock")
public class ClockController {

    @Autowired
    public IClockService service;

    /**
     * 打卡
     * */
    @GetMapping("/clock")
    public R clock(@RequestParam Integer userId){
        return service.clock(userId);
    }

    /**
     * 获取打卡状态
     * */
    @GetMapping("/clockState")
    public Boolean clockState(@RequestParam Integer userId){
        return service.clockState(userId);
    }

    /**
     * 获取打卡天数
     * */
    @GetMapping("/findClockCount")
    public Integer findClockCount(@RequestParam Integer userId){
        return service.findClockCount(userId);
    }

}
